package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.MonthServiceSummaryDTO;
import com.neusoft.neuiotms.dcom.model.MonthServiceSummary;

@Component
public class MonthServiceSummaryConverter extends AbstractConverter<MonthServiceSummary, MonthServiceSummaryDTO> {

    @Override
    public MonthServiceSummary toModel(final MonthServiceSummaryDTO dto) {

        final MonthServiceSummary model = new MonthServiceSummary();

        model.setServiceTypeCode(dto.getServiceTypeCode());
        model.setServiceTypeName(dto.getServiceTypeName());
        model.setServiceAttributesCode(dto.getServiceAttributesCode());
        model.setServiceAttributesName(dto.getServiceAttributesName());
        model.setTotalNumber(dto.getTotalNumber());
        model.setTotalTime(dto.getTotalTime());

        return model;
    }

    @Override
    public MonthServiceSummaryDTO toDTO(final MonthServiceSummary model, final boolean forListView) {

        final MonthServiceSummaryDTO dto = new MonthServiceSummaryDTO();
        dto.setId(model.getId());
        dto.setServiceTypeCode(model.getServiceTypeCode());
        dto.setServiceTypeName(model.getServiceTypeName());
        dto.setServiceAttributesCode(model.getServiceAttributesCode());
        dto.setServiceAttributesName(model.getServiceAttributesName());
        dto.setTotalNumber(model.getTotalNumber());
        dto.setTotalTime(model.getTotalTime());
        return dto;
    }

}
